<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入 jstl--%>
<%@include file="common/tag.jsp" %>
<html>
<head>
    <title>发布竞赛</title>
    <%@include file="common/head.jsp" %>
    <script src="/./resource/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        $(function () {
            $('.form_datetime').datetimepicker({
                language: 'zh-CN',
                format: 'yyyy-mm-dd hh:ii', //选择完日期后，input框里的时间值的格式
                startDate: new Date(), //开始日期时间，在此之前的都不可选，同理也有endDate
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 2,
                forceParse: 0,
                showMeridian: 1
            });
        });
    </script>
    <script>
        function clicke() {
            alert("发布成功！");
            var button = document.getElementById("commit");
            button.onclick = false;
        }
    </script>
    <style>
        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
        }

        #container {
            min-height: 100%;
            height: auto !important;
            height: 100%; /*IE6不识别min-height*/
            position: relative;
        }

        a {
            text-decoration: none
        }

        #page {
            width: 100%;
            margin-bottom: 50px; /*等于footer的高度*/
        }

    </style>

</head>
<body background="/./resource/images/bg.jpg" style="background-size: cover;background-repeat: no-repeat;">
<%--页面显示部分--%>
<div id="container" class="container">
    <jsp:include page="common/Top.jsp"/>
    <div id="page" class="panel panel-default">
        <div class="panel-heading">
            <h5><b>发布竞赛</b></h5>
        </div>
        <div class="row">
            <div class="col-lg-12" style="border:0px solid #000;margin-top: 10px;">
                <from:form action="/message/publish" method="post" class="form-horizontal"
                           commandName="publishMessage">
                    <div class="form-group" style="margin-right: 20px;margin-left: 20px;">
                        <from:label for="contestName" class="col-lg-1 control-label" path="title">竞赛名称</from:label>
                        <div class="col-lg-11 control-label">
                            <from:input path="title" id="contestName" class="form-control" type="text"
                                        name="contestName"/>
                        </div>
                    </div>
                    <div class="form-group" style="margin-right: 20px;margin-left: 20px;">
                        <from:label for="contestDetail" class="col-lg-1 control-label" path="content">竞赛详情</from:label>
                        <div class="col-lg-11">
                            <from:textarea path="content" id="contestDetail" class="form-control"
                                           name="contestDetail"></from:textarea>
                        </div>
                    </div>
                    <div class="form-group" style="margin-right: 20px;margin-left: 20px;">
                        <from:label for="contestDesc" class="col-lg-1 control-label" path="">报名时间</from:label>
                        <div class="col-lg-11">
                            <div class="row" style="margin: 0 auto;">
                                <from:input path="registerStart" type="text" name="entrollStart" class="Wdate"
                                            onfocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                            style="width: 200px"/> 至 <from:input path="registerEnd" type="text"
                                                                                 name="entrollEnd" class="Wdate"
                                                                                 onfocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                                                                 style="width: 200px"/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group" style="margin-right: 20px;margin-left: 20px;">
                        <from:label for="contestDesc" class="col-lg-1 control-label" path="">比赛时间</from:label>
                        <div class="col-lg-11">
                            <div class="row" style="margin: 0 auto;">
                                <from:input path="testStart" type="text" name="contestStart" class="Wdate"
                                            onfocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                            style="width: 200px"/> 至 <from:input path="testEnd" type="text"
                                                                                 name="contestEnd" class="Wdate"
                                                                                 onfocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                                                                 style="width: 200px"/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group" style="margin-right: 20px;margin-left: 20px;">
                            <%--<label for="contestDesc" class="col-lg-1 control-label"></label>--%>
                        <form:label path="request" class="col-lg-1 control-label">比赛要求</form:label>
                        <div class="col-lg-11">
                            <div class="row" style="margin-left: 4px;">
                                    <form:checkboxes items="${request}" path="request"/></td>
                                    <%--<div class="checkbox">
                                        <label><input type="checkbox" name="request" value="1"/>大一</label>
                                        <label style="margin-left: 20px;"><input type="checkbox" name="request"
                                                                                 value="2"/>大二</label>
                                        <label style="margin-left: 20px;"><input type="checkbox" name="request"
                                                                                 value="3"/>大三</label>
                                        <label style="margin-left: 20px;"><input type="checkbox" name="request"
                                                                                 value="4"/>大四</label>
                                        <label style="margin-left: 20px;"><input type="checkbox" name="request"
                                                                                 value="5"/>大五</label>
                                    </div>--%>
                            </div>
                        </div>
                    </div>
                    <div class="form-group" style="margin-right: 20px;margin-left: 20px;">
                        <from:label for="contestDesc" class="col-lg-1 control-label" path="">竞赛描述</from:label>
                        <div class="col-lg-11">
                            <from:textarea path="desc" id="contestDesc" class="form-control"
                                           name="contestDesc"></from:textarea>
                        </div>
                    </div>
                    <div class="form-group" style="margin-right: 20px;margin-left: 20px;">
                        <div class="row">
                            <div class="col-lg-1 col-lg-offset-1">
                                <input id="publish" onclick="clicke()" class="btn" type="submit"
                                       style="margin-left: 10px"
                                       value="发布"/>
                            </div>
                            <div class="col-lg-1 col-lg-offset-0">
                                <input class="btn" type="reset" value="重新填写"/>
                            </div>
                        </div>
                    </div>
                </from:form>
            </div>
        </div>
    </div>
    <jsp:include page="common/footer.jsp"/>
</div>
</body>
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</html>
